package com.maimao.model.es;

import com.maimao.model.es.EsSearchConvert;


/**
 * @author MaoLin Wang
 * @date 2021/4/28 上午10:21
 */
public class EsBoolConvert extends EsSearchConvert {
    public static final Integer ONE = 1;
    public static final Integer ZERO = 0;

    @Override
    public Object apply(Object value) {
        if (value == null) {
            return null;
        }
        if (value.equals(ONE)) {
            return Boolean.TRUE;
        } else if (value.equals(ZERO)) {
            return Boolean.FALSE;
        }
        return null;
    }
}
